cmake_minimum_required(VERSION 3.16.3)
project(14_net_camera_yolov8m)

set(HDPL_INSTALL_PATH $ENV{HOUMO_PATH})

find_package(OpenCV REQUIRED)
include_directories(
	${OpenCV_INCLUDE_DIRS}
	${HDPL_INSTALL_PATH}/include
	${PROJECT_SOURCE_DIR}/src/3rdparty/include
	${PROJECT_SOURCE_DIR}/src/3rdparty/include/libdrm/include
	${PROJECT_SOURCE_DIR}/src/3rdparty/include/libdrm/include/libdrm
	${PROJECT_SOURCE_DIR}/src/3rdparty/include/librga/include
	${PROJECT_SOURCE_DIR}/src/common_obj
	${PROJECT_SOURCE_DIR}/src/module_obj
	)

LINK_DIRECTORIES(
	${HDPL_INSTALL_PATH}/lib
	${PROJECT_SOURCE_DIR}/src/3rdparty/lib
	)

LINK_LIBRARIES(
	avformat
	avcodec
	avutil
	m
	z
	rockchip_mpp
	swresample
	lzma
	${OpenCV_LIBS} 
	hdplrt 
	tvm 
	drm
	rga 
	pthread
	)

# 查找${PROJECT_SOURCE_DIR}/src/目录下的所有 .cpp 文件，并将结果保存到 CPP_SRCS 变量中
file(GLOB_RECURSE CPP_SRCS ${PROJECT_SOURCE_DIR}/src/*.cpp)

#add_definitions(-w)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -O2")

add_executable(${PROJECT_NAME}  ${CPP_SRCS})

install(TARGETS ${PROJECT_NAME} DESTINATION ${PROJECT_SOURCE_DIR}/bin)

